/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package chapter5;

/**
 *
 * @author Denise Carolina
 */
public class Conditionals {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        int x = 1;
        if (x == 3){}
        else if ( x < 4) {System.out.println("x<4");}
        else if ( x < 2) {System.out.println("x<2");}
        else { System.out.println("else");}

        int y = 5; x = 2;
        if(((x>3) && (y<2)) | true){
            System.out.println("true_1");
        }

        if((x>3) && (y<2) | true){
            System.out.println("true_2");
        }

        boolean boo = false;
        if (boo = true){System.out.println("boo = true");}

        int x1 = 3;
        //if(x1 = 5) {} illegal

        final int b;
        b = 2;
        switch(1){
            //case b: System.out.println("case b");// illegal because b i snot iitialized
        }

        byte g = 120;
        switch(g){

            case 23: break;
            case 120: System.out.println("120");
            case 121: System.out.println("121");
            default: System.out.println("case default");
            //case 120: {System.out.println("do stuff");} duplicate case
            //case 128: break; // lost of precision
        }

        int even = 41;
        switch(even){
            case 0:
            case 2:
            default:{System.out.println("odd number"); break;}
            case 4:
            case 6:
            case 41: {System.out.println("own case 41");}
            case 8: {System.out.println("even number"); break;}
            
        }
    }

}
